package com.yswy.theater.vo.res;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yswy.theater.entity.TheaterPlayGather;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;

import java.util.ArrayList;
import java.util.List;

@Data
public class TheaterPlayGatherResVo {
    @TableId(type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("TheaterPlayId")
    private Long theaterPlayId;
    @ApiModelProperty("图片")
    private String playTitleUrl;
    @ApiModelProperty("播放地址")
    private String playUrl;
    @ApiModelProperty("集数")
    private Integer episodes;
    @ApiModelProperty("是否解锁 0 未解锁 1解锁")
    private Integer isUnlock;

    public static List<TheaterPlayGatherResVo> TheaterPlayGatherResVoUnlock(List<TheaterPlayGather> theaterPlayGathers) {
        List<TheaterPlayGatherResVo> theaterPlayGatherResVos = new ArrayList<>();
        for (TheaterPlayGather theaterPlayGather:theaterPlayGathers) {
            TheaterPlayGatherResVo theaterPlayGatherResVo = new TheaterPlayGatherResVo();
            theaterPlayGatherResVo.setId(theaterPlayGather.getId());
            theaterPlayGatherResVo.setTheaterPlayId(theaterPlayGather.getTheaterPlayId());
            theaterPlayGatherResVo.setPlayTitleUrl(theaterPlayGather.getPlayTitleUrl());
            theaterPlayGatherResVo.setPlayUrl(theaterPlayGather.getPlayUrl());
            theaterPlayGatherResVo.setEpisodes(theaterPlayGather.getEpisodes());
            theaterPlayGatherResVo.setIsUnlock(1);
            theaterPlayGatherResVos.add(theaterPlayGatherResVo);
        }

        return theaterPlayGatherResVos ;
    }
}
